/***********************************************
* Filename:  		DXHandler.h
* Date:      		01/12/2014
* Mod. Date: 		01/12/2014
* Author:    		Night
* Purpose:   		Handles the DirectX 9 Graphics API
************************************************/

#ifndef DX_HANDLER_H_
#define DX_HANDLER_H_

#if _DEBUG
#define D3D_DEBUG_INFO
#endif

#include "../IRenderer.h"

#include <d3d9.h>
#include <d3dx9.h>
#include <d3dx9math.h>
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")


class CDXScreenRender;
class CDXHandler : public IRenderer
{
public:
	CDXHandler( void );
	~CDXHandler( void );

	bool Init( const HWND _hWnd, const unsigned int _unWindowWidth, const unsigned int _unWindowHeight );
	bool Init( const char *_szFilePath );

	void Release( void );

	void Clear( void );
	void Present( void );
	void BeginScene( void );
	void EndScene( void );

	void Render( void );

	inline CDXScreenRender *GetScreenRender( void ) { return m_pScreenRender; };
private:
	IDirect3D9				*m_pD3DObject;
	IDirect3DDevice9		*m_pD3DDevice;
	D3DPRESENT_PARAMETERS	m_D3DPresentParam;

	CDXScreenRender			*m_pScreenRender;
};

#endif